/*
 *
 *  Copyright (C) 2012-2024
 *  All rights reserved, Designed By 杭州连线客信息技术有限公司
 *  注意：
 *  本软件为杭州连线客信息技术有限公司开发研制，未经购买不得使用
 *  购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
 *  一经发现盗用、分享等行为，将追究法律责任，后果自负
 *
 */

package com.lxk.oms.postorder.domain.req;

import com.lxk.oms.order.domain.req.BaseReq;
import com.lxk.oms.postorder.domain.bo.OmsPostOrderAddressBo;
import com.lxk.oms.postorder.domain.enums.PostOrderEnums;
import com.lxk.oms.postorder.flow.audit.PoAuditContext;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;

/**
 * @author heyi
 * 2024/10/22
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AutoMapper(target = PoAuditContext.class, reverseConvertGenerate = false)
public class AuditPostOrderReq extends BaseReq {

    /**
     * 售后订单编号
     */
    @NotBlank(message = "请输入售后订单编号")
    private String postOrderNo;

    /**
     * 审核状态
     * false 审核不通过  true=审核通过，进入待退货状态
     *
     * @see PostOrderEnums.PostOrderStatus
     */
    @NotNull(message = "请输入审核状态")
    private Boolean postOrderStatus;


    /**
     * 商家收货地址
     */
    private Address merAddress;

    /**
     * 备注
     */
    private String remark;


    /**
     * 商家-收货地址
     */
    @Data
    @AutoMapper(target = OmsPostOrderAddressBo.class, reverseConvertGenerate = false)
    public static class Address {
        /**
         * 联系人名称
         */
        @NotBlank(message = "联系人名称不能为空", groups = {AddGroup.class, EditGroup.class})
        private String receiverName;

        /**
         * 联系人手机
         */
        @NotBlank(message = "联系人手机不能为空", groups = {AddGroup.class, EditGroup.class})
        private String receiverMobile;

        /**
         * 联系人详细地址
         */
        @NotBlank(message = "联系人详细地址不能为空", groups = {AddGroup.class, EditGroup.class})
        private String receiverDetailAddress;

        /**
         * 订单省份ID
         */
        @NotNull(message = "订单省份ID不能为空", groups = {AddGroup.class, EditGroup.class})
        private Long orderProvinceId;

        /**
         * 订单省份名称
         */
        @NotBlank(message = "订单省份名称不能为空", groups = {AddGroup.class, EditGroup.class})
        private String orderProvinceName;

        /**
         * 订单城市ID
         */
        @NotNull(message = "订单城市ID不能为空", groups = {AddGroup.class, EditGroup.class})
        private Long orderCityId;

        /**
         * 订单城市名称
         */
        @NotBlank(message = "订单城市名称不能为空", groups = {AddGroup.class, EditGroup.class})
        private String orderCityName;

        /**
         * 订单区县ID
         */
        @NotNull(message = "订单区县ID不能为空", groups = {AddGroup.class, EditGroup.class})
        private Long orderDistrictId;

        /**
         * 订单区县名称
         */
        @NotBlank(message = "订单区县名称不能为空", groups = {AddGroup.class, EditGroup.class})
        private String orderDistrictName;


        public static Address mock() {
            Address address = new Address();
            address.setReceiverName("1");
            address.setReceiverMobile("2");
            address.setReceiverDetailAddress("3");
            address.setOrderProvinceId(1L);
            address.setOrderProvinceName("4");
            address.setOrderCityId(2L);
            address.setOrderCityName("2");
            address.setOrderDistrictId(3L);
            address.setOrderDistrictName("5");
            return address;
        }
    }


}
